package icu.qx.qc.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import icu.qx.qc.mapper.QcQualityProjectMapper;
import icu.qx.qc.domain.QcQualityProject;
import icu.qx.qc.service.IQcQualityProjectService;

/**
 * 质检项目Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-12
 */
@Service
public class QcQualityProjectServiceImpl implements IQcQualityProjectService 
{
    @Autowired
    private QcQualityProjectMapper qcQualityProjectMapper;

    /**
     * 查询质检项目
     * 
     * @param qualityCode 质检项目主键
     * @return 质检项目
     */
    @Override
    public QcQualityProject selectQcQualityProjectByQualityCode(String qualityCode)
    {
        return qcQualityProjectMapper.selectQcQualityProjectByQualityCode(qualityCode);
    }

    /**
     * 查询质检项目列表
     * 
     * @param qcQualityProject 质检项目
     * @return 质检项目
     */
    @Override
    public List<QcQualityProject> selectQcQualityProjectList(QcQualityProject qcQualityProject)
    {
        return qcQualityProjectMapper.selectQcQualityProjectList(qcQualityProject);
    }

    /**
     * 新增质检项目
     * 
     * @param qcQualityProject 质检项目
     * @return 结果
     */
    @Override
    public int insertQcQualityProject(QcQualityProject qcQualityProject)
    {
        qcQualityProject.setCreateTime(DateUtils.getNowDate());
        return qcQualityProjectMapper.insertQcQualityProject(qcQualityProject);
    }

    /**
     * 修改质检项目
     * 
     * @param qcQualityProject 质检项目
     * @return 结果
     */
    @Override
    public int updateQcQualityProject(QcQualityProject qcQualityProject)
    {
        qcQualityProject.setUpdateTime(DateUtils.getNowDate());
        return qcQualityProjectMapper.updateQcQualityProject(qcQualityProject);
    }

    /**
     * 批量删除质检项目
     * 
     * @param qualityCodes 需要删除的质检项目主键
     * @return 结果
     */
    @Override
    public int deleteQcQualityProjectByQualityCodes(String[] qualityCodes)
    {
        return qcQualityProjectMapper.deleteQcQualityProjectByQualityCodes(qualityCodes);
    }

    /**
     * 删除质检项目信息
     * 
     * @param qualityCode 质检项目主键
     * @return 结果
     */
    @Override
    public int deleteQcQualityProjectByQualityCode(String qualityCode)
    {
        return qcQualityProjectMapper.deleteQcQualityProjectByQualityCode(qualityCode);
    }
}
